package com.qingcloud.adminbackend.entity.message;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;

/**
 * 事件计算规则
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_message_event_cal_rule")
public class SysMessageEventCalRule extends Model {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "事件编号", example = "E1241", hidden = true)
    private String eventCode;

    @ApiModelProperty(value = "告警等级")
    private String warnLevel;

    @ApiModelProperty(value = "计算数据范围")
    private Integer dataMinute;

    @ApiModelProperty(value = "规则报警描述")
    private String warnDesc;

    @ApiModelProperty(value = "比较类型")
    @TableField(exist = false)
    @Valid
    private List<SysMessageEventCalCompare> compareList = new ArrayList<>();
}
